package com.yuju.upload.enums;

import com.yuju.enums.ReturnCodeEnum;

public enum UploadReturnCodeEnum {
	UPLOAD_SUCCESS("filesvr-1004", "文件上传成功"),
	UPLOAD_FALURE("filesvr-1005", "文件上传失败"),
	FILE_DEL_SUCCESS("filesvr-1006", "文件删除成功"),
	FILE_DEL_FALURE("filesvr-1007", "文件删除失败");
	
	private String code;
	private String desc;
	
	UploadReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public static String getDescByCode(String code) {
		for (ReturnCodeEnum enume : ReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		return "未知枚举项";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
